/*
 * BinaryStream.h
 *
 *  Created on: Jan 13, 2014
 *      Author: knuke
 */

#ifndef BINARYSTREAM_H_
#define BINARYSTREAM_H_

#include <string>
#include <fstream>
#include <vector>
#include <glm/glm.hpp>
#include "Types.h"

namespace graphiclicious_converter
{

  class BinaryStream
  {
  public:
    BinaryStream();
    virtual ~BinaryStream();

    void open(std::string filename, bool buffered = true);
    void writeInt(int i);
    void writeFloat(float f);
    void writeFloats(float* f, int len);
    void writeBytes(uchar* bytes, int len);
    void writeBytesReverse(uchar* bytes, int len);
    void flush();

  private:
    std::ofstream out_;
    bool buffered_;
  };

} /* namespace graphiclicious_converter */

#endif /* BINARYSTREAM_H_ */
